﻿
# 偏函数
# import functools

print "int('12345') =",int('12345')
print "int('12345',base=8) =",int('12345',base=8)

def int2(x,base=2):
	return int(x,base)

print "int2 =",int2
print "int2('10000000')",int2('10000000')
print "int2('10110010') =",int2('10110010')

import functools
int2=functools.partial(int,base=2)
print "int2 =",int2
print "int2('10000000') =",int2('10000000')
print "int2('10110010') =",int2('10110010')
print "int2('10000000',base=8) =",int2('10000000',base=8)
print "int2('10110010',base=8) =",int2('10110010',base=8)

print "max(2,4,5,7) =",max(2,4,5,7)
max2=functools.partial(max,10)
print "max2=functools.partial(max,10)"
print "max2(2,4,5,7) =",max2(2,4,5,7)
